import 'package:beautyflutter/componts/base_cared.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class CardSpecial extends BaseCard {

  @override
  _CardSpecial createState() => _CardSpecial();
}
class _CardSpecial extends BaseCardState {
  @override
  topContent() {
    return Column(
      children: <Widget>[
        Container(
          padding: EdgeInsets.only(left: 66, right: 66, top: 36, bottom: 30),
          decoration: BoxDecoration(color: Color(0xfffffcf7)),
          child: Container(
            decoration: BoxDecoration(
              boxShadow: [
                BoxShadow(
                  color: Colors.grey,
                  blurRadius: 20,
                  offset: Offset(0, 10) //水平偏移和垂直偏移
                )
              ]
            ),
            child: Image.network('https://gitee.com/CASE_CAI/img/raw/master/shengdoushixingshi.jpg'),
          ),
        ),
        Container(
          padding: EdgeInsets.only(left: 10, top: 15, bottom: 15, right: 20),
          decoration: BoxDecoration(color: Color(0xfff7f3ea)),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              Container(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Container(
                      child: Text('长安十二时辰...', style: TextStyle(
                          color: Colors.black,
                          fontSize: 16
                      )),
                    ),
                    Container(
                      padding: EdgeInsets.only(top: 10),
                      child: Text('马伯庸', style: TextStyle(
                          color: Colors.grey,
                          fontSize: 12
                      )),
                    )
                  ],
                ),
              ),
              RaisedButton(
                onPressed: () {
                  print('点击分享');
                },
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(20)
                ),
                padding: EdgeInsets.only(left: 10, right: 10),
                color: Colors.deepOrange,
                child: Text('分享免费领', style: TextStyle(color: Colors.white, fontSize: 12),),
              )
            ],
          ),
        )
      ],
    );
  }
  @override
  bottomContent() {
    return Expanded(
      child: Column(
        children: <Widget>[
          Expanded(
            child: Container(
              alignment: AlignmentDirectional.centerStart,
              child: Padding(
                padding: EdgeInsets.only(top: 50, left: 30),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Icon(Icons.explore),
                    Text('揭露历史真相', style: TextStyle(color: Colors.black54, fontSize: 12))
                  ],
                ),
              ),
            ),
          ),
          Padding(
            padding: EdgeInsets.only(bottom: 20),
            child: Container(
              child: Text('更多免费好书不断', style: TextStyle(color: Colors.blue, fontSize: 15)),
            ),
          )
        ],
      ),
    );
  }
}